#!/bin/bash

yum -y localinstall elasticsearch-6.8.0.rpm

sed -i '23s/.*/node.name: Services/;
        33s/.*/path.data: \/var\/lib\/elasticsearch/;   
        37s/.*/path.logs: \/var\/log\/elasticsearch/;   
        55s/.*/network.host: 0.0.0.0/;               
        59s/.*/http.port: 9200/;                     
        60s/.*/http.cors.enabled: true/;            
        61s/.*/http.cors.allow-origin: "*"/' /etc/elasticsearch/elasticsearch.yml 

systemctl enable elasticsearch --now